<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Transdmin Light</title>

		<!-- CSS -->
		<link href="<%=basePath%>style/css/transdmin.css" rel="stylesheet"
			type="text/css" media="screen" />
		<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="<%=basePath%>style/css/ie6.css" /><![endif]-->
		<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="<%=basePath%>style/css/ie7.css" /><![endif]-->
		<link href="<%=basePath%>style/css/thickbox.css" rel="stylesheet"
			type="text/css" media="screen" />
		<!-- JavaScripts-->
		<script type="text/javascript" src="<%=basePath%>style/js/jquery.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/thickbox.js"></script>
		<script type="text/javascript" src="<%=basePath%>style/js/jNice.js"></script>
		<script type="text/javascript">
			$(function(){
			//截取显示的content并添加"..."
				var varstring=$(".content").val();	
				if(varstring.length>30){			
					$(".content").text(varstring.substr(0,20)+"...");
				}				
				//选择对象二级
				$("#first").change(function(){				
					var var1= $("#first").val();
					if(var1==2){
						$("#second").children().remove();
					}
					$.getJSON("cm!ajax.my",{type:var1,date:new Date().getTime()},function(data){
						$("#second").children().remove();					    
						for(var i=0;i<data.list.length;i++){
						$("#second").append("<option value="+data.list[i].feedbackPersonId+">"+data.list[i].name+"</option>");
						}
					});
				});
					
				//提交
				$("#btnsubmit").click(function(){
					var varcontent = $("#content1").val();
					//alert($("#content1").attr("rows"))
					var vartype=$("#first").val();
					var varmemberid = $("#second").val();	
					var varmembername =$("#second").find("option:selected").text();									
					$.getJSON("cm!update.my",{content:varcontent,name:varmembername,type:vartype,memberid:varmemberid,date:new Date().getTime()},function(data){
						var tr = $("#mytable tr:first").clone();
						tr.find(".time").text(data.time);
						tr.find(".name").text(data.misonFeedbackPerson.name);
						tr.find(".content").text(data.content);						
						tr.insertBefore($("#mytable tr:first"));
					});					
				});
		
				
								
			});
		</script>
	</head>
	<body>
		<h3><a href="<%=basePath %>cm!show.my">点我点我哦</a></h3>
		<div id="wrapper">
			<!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
			<h1>
				<a href="#"><span>Transdmin Light</span>
				</a>
			</h1>

			<!-- You can name the links with lowercase, they will be transformed to uppercase by CSS, we prefered to name them with uppercase to have the same effect with disabled stylesheet -->
			<ul id="mainNav">
				<li>
					<a href="#" class="active">个人查询</a>
				</li>
				<!-- Use the "active" class for the active menu item  -->
				<li>
					<a href="#">提交反馈</a>
				</li>
				<li>
					<a href="#">课程情况查询</a>
				</li>
				<li>
					<a href="#">查看其他学员信息</a>
				</li>
				<li class="logout">
					<a href="#">安全退出</a>
				</li>
			</ul>
			<!-- // #end mainNav -->

			<div id="containerHolder">
				<div id="container">
					<div id="sidebar">
						<ul class="sideNav">
							<li>
								<a href="#">个人信息</a>
							</li>
							<li>
								<a href="#" class="active">提交反馈</a>
							</li>
							<li>
								<a href="#">课程情况查询</a>
							</li>
							<li>
								<a href="#">查看其它学员</a>
							</li>
							
						</ul>
						<!-- // .sideNav -->
					</div>
					<!-- // #sidebar -->

					<!-- h2 stays for breadcrumbs -->
					<h2>
						<a href="#">服务质量反馈系统</a> &raquo;
						<a href="#" class="active">提交反馈信息</a>
					</h2>

					<div id="main">						
							<h3>
								学生反馈记录
							</h3>
							<table cellpadding="0" cellspacing="0" id="mytable">
							<c:forEach items="${cm.list}" var="m">
								<tr>
									<td class="time">
										${m.time}
									</td>
									<td class="name">
										${m.misonFeedbackPerson.name}
									</td>
									<td class="content">
										${m.content}
									</td>
									<td class="action">										
										<a href="#TB_inline?height=200&width=400&inlineId=div1" title="View" class="thickbox">View</a>
										<a href="<%=basePath%>edit.html?keepThis=true&TB_iframe=true&height=280&width=400" title="Edit" class="thickbox">Edit</a>
										<a href="#" class=”thickbox”>Delete</a>
									</td>
								</tr>								
							</c:forEach>
							</table>
							<div id="div1" style="display:none">
  		 						<P> </P>
  		 					</div>
							<h3>
								提交反馈
							</h3>
							<fieldset>
								<p>
									<label>
										选择对象:
									</label>
										<select id="first">
										<option value="2">
										   未选择
										</option>
										<option  value="0">
											讲师
										</option>
										<option  value="1">
											客服
										</option>
										</select>
										<select id="second" >
											<option>
											   未选择
											</option>								
										</select>
									
									
								</p>
								<p>
									<label>
										内容:
									</label>
									<textarea id="content1" rows="20" cols="8"></textarea>
								<p>									
									是否公开：<input id="mycheck" type="checkbox" value="1"/>								
								</p>
								<input id="btnsubmit" type="button" value="提交" />
							</fieldset>						
					</div>
					<!-- // #main -->

					<div class="clear"></div>
				</div>
				<!-- // #container -->
			</div>
			<!-- // #containerHolder -->

			<p id="footer">
				Feel free to use and customize it.
				<a href="#">Credit is appreciated.</a>
			</p>
		</div>
		<!-- // #wrapper -->
		<a href="http://www.baidu.com/?keepThis=true&TB_iframe=true&height=250&width=400" title="添加" class="thickbox">Example 1</a>
		<!-- 测试用 -->
		<input alt="#TB_inline?height=300&width=400&inlineId=div1" title="shawnliu" class="thickbox" type="button" value="Show" />   
   		<a href="#TB_inline?height=155&width=300&inlineId=div2&modal=true" class="thickbox">Show hidden modal content.</a>
   
   		<div id="div1" style="display:none">
  		 	<P>
    			 这是一个非模式对话框。
   			</P>
   		</div>

   		<div id="div2" style="display:none">
   		<p>
     		这是一个模式对话框。
     		<p style="TEXT-ALIGN: center"><INPUT id="Login" onclick="tb_remove()" type="submit" value="  Ok  " /></p>
   		</p>
   		</div>
	</body>
</html>
